#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
typedef long long ll;
const int maxn = 1000;
int month_days[2][13]={{0,31,28,31,30,31,30,31,31,30,31,30,31},{0,31,29,31,30,31,30,31,31,30,31,30,31}};
int isLeap(int year)
{
	return (year%4==0 && year%100!=0 || year%400==0);
}
int daynum(int date){
	int num=0;
	int year=date/10000;
	int month=(date/100)%100;
	int day=date%100;
	for(int i=1;i<year;i++){
		if(isLeap(year)) num+=366;
		else num+=365;
	}
	for(int j=1;j<month;j++){
		num+=month_days[isLeap(year)][j]; 
	}
	num+=day;
	return num;
}
int main()
{
	int num=0;
	int date1,date2;
	while(scanf("%d%d",&date1,&date2)==2){
		int day1=daynum(date1);
		int day2=daynum(date2);
		int s=abs(day1-day2)+1;
		printf("%d\n",s); 
	
	} 

	return 0;
}

